import Vue from 'vue'
import VueRouter from 'vue-router'
import loginIndex from '@/views/login/index.vue'
import MainLayout from '@/views/main-layout'
import OrderIndex from '@/views/order/order'
import TaskIndex from '@/views/task/task'
import HomeIndex from '@/views/home-index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: loginIndex
  },
  {
    path: '/',
    redirect: {
      name: 'login'
    }
  },
  {
    path: '/home',
    component: MainLayout,
    children: [{
      path: '/shouYe',
      name: 'shouYe',
      component: HomeIndex
    },
    {
      path: '/order',
      name: 'order',
      component: OrderIndex
    },
    {
      path: '/task',
      name: 'task',
      component: TaskIndex
    }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
